package com.kaibes.platform.currency.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.kaibes.platform.currency.db.CurrencyService;
import com.kaibes.platform.currency.db.CurrencyUserService;

@Component
public class CurrencyUtils {

    @Autowired
    private CurrencyService currencyService;
    @Autowired
    private CurrencyUserService currencyUserService;
    
    public String getName(Integer id) {
        return currencyService.getNameById(id);
    }
    
    public long getAmount(Integer userId, Short currencyId) {
        return currencyUserService.getAmountByUserIdAndCurrencyId(userId, currencyId);
    }
}
